package com.jintoufs.dao.travelagency.impl;

import com.jintoufs.dao.MyBatisSupport;
import com.jintoufs.dao.QueryFilters;
import com.jintoufs.dao.travelagency.PoiDAO;
import com.jintoufs.domain.travelagency.Poi;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 用户管理dao层接口实现
 *
 * @author tcq
 */
@Repository
public class PoiDAOImpl extends MyBatisSupport<PoiDAO, Poi> implements PoiDAO {
//    private static Map<String, Object> fildMap = new HashMap<String, Object>() {
//        {
//            put("id", "p.id");
//        }
//    };

    @Override
    public List<Map> getByFilter(QueryFilters filters) {
        // 查询字段过滤，不允许不合法字段进入SQL
        //filters.format(fildMap);
        return getMapper().getByFilter(filters);
    }

    @Override
    public int updateByPrimaryKeyWithBLOBs(Poi Poi) {
        return getMapper().updateByPrimaryKeyWithBLOBs(Poi);
    }

    @Override
    public int insert(Poi Poi) {
        return getMapper().insert(Poi);
    }

    @Override
    public int deleteByPrimaryKey(String id) {
        return getMapper().deleteByPrimaryKey(id);
    }

    @Override
    public List<Map<String, Object>> getByParams(Map<String, Object> params) {
        return getMapper().getByParams(params);
    }


    @Override
    public Poi selectByPrimaryKey(String id) {
        return getMapper().selectByPrimaryKey(id);
    }

}
